import bus from '@/bus'
import { renderButton } from '@/util';
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize,
  currentPage: 1,
  form: {
    storeTypeId: '',
    tiresRim: '',
    isEnabled: ''
  },
  options: {
    status: [{
      value: 1,
      label: '是'
    }, {
      value: 0,
      label: '否'
    }]
  },
  columns: [{
    type: 'selection',
    width: 60,
    align: 'left'
  }, {
    title: '编号',
    key: 'id',
    align: 'left',
    minWidth: 200
  }, {
    title: '门店类型',
    key: 'storeTypeName',
    align: 'left',
    minWidth: 150
  }, {
    title: '品牌',
    key: 'brandName',
    align: 'left',
    minWidth: 150
  }, {
    title: '胎面宽',
    key: 'tiresWidth',
    align: 'left',
    minWidth: 150
  }, {
    title: '扁平率',
    key: 'tiresAspectratio',
    align: 'left',
    minWidth: 150
  }, {
    title: '尺寸',
    key: 'tiresRim',
    align: 'left',
    minWidth: 150
  }, {
    title: '花纹',
    key: 'figure',
    align: 'left',
    minWidth: 150
  }, {
    title: '是否计算',
    align: 'left',
    key: 'isCounting',
    minWidth: 100,
    render: (h, params) => {
      const row = params.row
      if (row.isCounting) {
        return h('div', '是')
      } else {
        return h('div', '否')
      }
    }
  },
  // {
  //   title: '最大任务量',
  //   key: 'maxCountingQuantity',
  //   align: 'left'
  // },
  {
    title: '操作',
    align: 'right',
    minWidth: 180,
    render: (h, params) => {
      const row = params.row
      let editBtn = renderButton(h, { text: '编辑', type: 'primary' }, ()=>{ bus.$emit("onEdit", { id: row.id })})
      let delBtn = renderButton(h, { text: '删除', type: 'warning' }, ()=>{ bus.$emit("onDelete", row.id, params.index)})
      return h('div', [editBtn, delBtn])
    }
  }],
  data: []
}
export default data